package user;

import book.BookList;
import option.*;

import java.util.Scanner;

public class Manager extends User{
    private Ioperate[] ioperates = {
            new Exit(),
            new Find(),
            new Add(),
            new Delete(),
            new Show()
    };

    @Override
    public int menu() {
        System.out.println("1.查看图书");
        System.out.println("2.增加图书");
        System.out.println("3.删除图书");
        System.out.println("4.展示所有图书");
        System.out.println("0.退出系统");
        System.out.println("请输入您的选择：");

        Scanner scan = new Scanner(System.in);

        int choice = scan.nextInt();

        return choice;
    }

    @Override
    public void work(int i, BookList bookList) {
        ioperates[i].work(bookList);
    }
}
